home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 January / enter-2004-01.iso / files / maxima-5.9.0.exe / {app} / info / maxima.info-8 < prev    next >
Encoding:
GNU Info File  |  2003-02-09  |  35.0 KB  |  789 lines

  1. This is maxima.info, produced by makeinfo version 4.1 from maxima.texi.
  2.  
  3.    This is a Texinfo Maxima Manual
  4.  
  5.    Copyright 1994,2001 William F. Schelter
  6.  
  7. START-INFO-DIR-ENTRY
  8. * Maxima: (maxima).     A computer algebra system.
  9. END-INFO-DIR-ENTRY
  10.  
  11. 
  12. File: maxima.info,  Node: Definitions for Differential Equations,  Prev: Differential Equations,  Up: Differential Equations
  13.  
  14. Definitions for Differential Equations
  15. ======================================
  16.  
  17.  - Function: DESOLVE ([eq1,...,eqn],[var1,...,varn])
  18.      where the eq's are differential equations in the dependent
  19.      variables var1,...,varn.  The functional relationships must be
  20.      explicitly indicated in both the equations and the variables. For
  21.      example
  22.           (C1) 'DIFF(F,X,2)=SIN(X)+'DIFF(G,X);
  23.           (C2) 'DIFF(F,X)+X^2-F=2*'DIFF(G,X,2);
  24.           is NOT the proper format.  The correct way is:
  25.           (C3) 'DIFF(F(X),X,2)=SIN(X)+'DIFF(G(X),X);
  26.           (C4) 'DIFF(F(X),X)+X^2-F(X)=2*'DIFF(G(X),X,2);
  27.           The call is then DESOLVE([D3,D4],[F(X),G(X)]);
  28.           If initial conditions at 0 are known, they should be supplied before
  29.           calling DESOLVE by using ATVALUE.
  30.           (C11) 'DIFF(F(X),X)='DIFF(G(X),X)+SIN(X);
  31.                                   d         d
  32.           (D11)                   -- F(X) = -- G(X) + SIN(X)
  33.                                   dX        dX
  34.           (C12) 'DIFF(G(X),X,2)='DIFF(F(X),X)-COS(X);
  35.                                    2
  36.                                   d          d
  37.           (D12)                   --- G(X) = -- F(X) - COS(X)
  38.                                     2        dX
  39.                                   dX
  40.           (C13) ATVALUE('DIFF(G(X),X),X=0,A);
  41.           (D13)                                A
  42.           (C14) ATVALUE(F(X),X=0,1);
  43.           (D14)                                1
  44.           (C15) DESOLVE([D11,D12],[F(X),G(X)]);
  45.                           X                            X
  46.           (D16) [F(X)=A %E  - A+1, G(X) = COS(X) + A %E  - A + G(0) - 1]
  47.           /* VERIFICATION */
  48.           (C17) [D11,D12],D16,DIFF;
  49.                             X       X      X                X
  50.           (D17)        [A %E  = A %E , A %E  - COS(X) = A %E  - COS(X)]
  51.  
  52.      If DESOLVE cannot obtain a solution, it returns "FALSE".
  53.  
  54.  
  55.  - Function: IC1 (exp,var,var)
  56.      In order to solve initial value problems (IVPs) and boundary value
  57.      problems (BVPs), the routine IC1 is available in the ODE2 package
  58.      for first order equations, and IC2 and BC2 for second order IVPs
  59.      and BVPs, respectively.  Do LOAD(ODE2) to access these.  They are
  60.      used as in the following examples:
  61.           (C3) IC1(D2,X=%PI,Y=0);
  62.                                    COS(X) + 1
  63.           (D3)               Y = - ----------
  64.                                         3
  65.                                        X
  66.           (C4) 'DIFF(Y,X,2) + Y*'DIFF(Y,X)^3 = 0;
  67.                                  2
  68.                                 d Y      dY 3
  69.           (D4)                  --- + Y (--)  = 0
  70.                                   2      dX
  71.                                 dX
  72.           (C5) ODE2(%,Y,X);
  73.                            3
  74.                           Y  - 6 %K1 Y - 6 X
  75.           (D7)            ------------------ = %K2
  76.                                   3
  77.           (C8) RATSIMP(IC2(D7,X=0,Y=0,'DIFF(Y,X)=2));
  78.                                3
  79.                             2 Y  - 3 Y + 6 X
  80.           (D9)            - ---------------- = 0
  81.                                    3
  82.           (C10) BC2(D7,X=0,Y=1,X=1,Y=3);
  83.                            3
  84.                           Y  - 10 Y - 6 X
  85.           (D11)           --------------- = - 3
  86.                                  3
  87.  
  88.  
  89.  - Function: ODE (equation,y,x)
  90.      This no longer exists in Maxima.  The documentation is left here
  91.      for historical purposes.
  92.  
  93.      a pot-pourri of Ordinary Differential solvers combined in such a
  94.      way as to attempt more and more difficult methods as each fails.
  95.      For example, the first attempt is with ODE2, so therefore, a user
  96.      using ODE can assume he has all the capabilities of ODE2 at the
  97.      very beginning and if he has been using ODE2 in programs they will
  98.      still run if he substitutes ODE (the returned values, and calling
  99.      sequence are identical).  In addition, ODE has a number of user
  100.      features which can assist an experienced ODE solver if the basic
  101.      system cannot handle the equation.  The equation is of the same
  102.      form as required for ODE2 (which see) and the y and x are
  103.      dependent and independent variables, as with ODE2.  For more
  104.      details, do PRINTFILE(ODE,USAGE,SHARE); .
  105.  
  106.  
  107.  - Function: ODE2 (exp,dvar,ivar)
  108.      takes three arguments: an ODE of first or second order (only the
  109.      left hand side need be given if the right hand side is 0), the
  110.      dependent variable, and the independent variable.  When
  111.      successful, it returns either an explicit or implicit solution for
  112.      the dependent variable.  %C is used to represent the constant in
  113.      the case of first order equations, and %K1 and %K2 the constants
  114.      for second order equations.  If ODE2 cannot obtain a solution for
  115.      whatever reason, it returns FALSE, after perhaps printing out an
  116.      error message.  The methods implemented for first order equations
  117.      in the order in which they are tested are: linear, separable,
  118.      exact - perhaps requiring an integrating factor, homogeneous,
  119.      Bernoulli's equation, and a generalized homogeneous method.  For
  120.      second order: constant coefficient, exact, linear homogeneous with
  121.      non-constant coefficients which can be transformed to constant
  122.      coefficient, the Euler or equidimensional equation, the method of
  123.      variation of parameters, and equations which are free of either the
  124.      independent or of the dependent variable so that they can be
  125.      reduced to two first order linear equations to be solved
  126.      sequentially.  In the course of solving ODEs, several variables
  127.      are set purely for informational purposes: METHOD denotes the
  128.      method of solution used e.g. LINEAR, INTFACTOR denotes any
  129.      integrating factor used, ODEINDEX denotes the index for
  130.      Bernoulli's method or for the generalized homogeneous method, and
  131.      YP denotes the particular solution for the variation of parameters
  132.      technique.
  133.  
  134.  
  135. 
  136. File: maxima.info,  Node: Numerical,  Next: Statistics,  Prev: Differential Equations,  Up: Top
  137.  
  138. Numerical
  139. *********
  140.  
  141. * Menu:
  142.  
  143. * Introduction to Numerical::
  144. * DCADRE::
  145. * ELLIPT::
  146. * FOURIER::
  147. * NDIFFQ::
  148. * Definitions for Numerical::
  149.  
  150. 
  151. File: maxima.info,  Node: Introduction to Numerical,  Next: DCADRE,  Prev: Numerical,  Up: Numerical
  152.  
  153. Introduction to Numerical
  154. =========================
  155.  
  156. 
  157. File: maxima.info,  Node: DCADRE,  Next: ELLIPT,  Prev: Introduction to Numerical,  Up: Numerical
  158.  
  159. DCADRE
  160. ======
  161.  
  162.    The following is obsolete and does not exist in Maxima 5.9.  We leave
  163. the documentation here for historical purposes.
  164.  
  165.    To make an interface to fortran libraries in the current MAXIMA look
  166. at the examples in "maxima/src/fortdef.lsp"  - The IMSL version of
  167. Romberg integration is now available in Macsyma.  For documentation, Do
  168. PRINTFILE(DCADRE,USAGE,IMSL1); .  For a demo, do batch("dcadre.mc");
  169. This is a numerical integration package using cautious, adaptive
  170. Romberg extrapolation.  The DCADRE package is written to call the IMSL
  171. fortran library routine DCADRE. This is documentation for that program.
  172. Send bugs/comments to KMP To load this package, do
  173.        LOADFILE("imsl")$
  174.    For a demo of this package, do
  175.        batch("dcadre.mc");
  176.    The worker function takes the following syntax:
  177. IMSL_ROMBERG(fn,low,hi) where fn is a function of 1 argument; low and
  178. hi should be the lower and upper bounds of integration. fn must return
  179. floating point values.  IMSL_ROMBERG(exp,var,low,hi)   where exp should
  180. be integrated over the range var=low to hi. The result   of evaluating
  181. exp must always be a floating point number.
  182. FAST_IMSL_ROMBERG(fn,low,hi)   This function does no error checking but
  183. may achieve a speed gain over   the IMSL_ROMBERG function. It expects
  184. that fn is a Lisp function (or   translated Macsyma function) which
  185. accepts a floating point argument   and that it always returns a
  186. floating point value.
  187.  
  188.    Returns either  [SUCCESS, answer, error] where answer is the result
  189. of the integration and   error is the estimated bound on the absolute
  190. error of the output, DCADRE,   as described in PURPOSE below.  or
  191. [WARNING, n, answer, error] where n is a warning code, answer is the
  192. answer,   and error is the estimated bound on the absolute error of the
  193. output, DCADRE,   as described in PURPOSE below. The following warnings
  194. may occur:      65 = One or more singularities were successfully
  195. handled.       66 = In some subinterval(s), the estimate of the
  196. integral was accepted           merely because the estimated error was
  197. small, even though no regular           behavior was recognized.  or
  198. [ERROR, errorcode] where error code is the IMSL-generated    error
  199. code. The following error codes may occur:      131 = Failure due to
  200. insufficient internal working storage.       132 = Failure. This may be
  201. due to too much noise in function            (relative to the given
  202. error requirements) or due to an            ill-behaved integrand.
  203. 133 = RERR is greater than 0.1 or less than 0.0 or is too small
  204.    for the precision of the machine.
  205.  
  206.    The following flags have an influence upon the operation of
  207. IMSL_ROMBERG -
  208.  
  209.    ROMBERG_AERR [Default 1.0E-5] - Desired absolute error in answer.
  210.  
  211.    ROMBERG_RERR [Default 0.0] - Desired relative error in the answer.
  212.  
  213.    Note: If IMSL signals an error, a message will be printed on the
  214. user's         console stating the nature of the error. (This error
  215. message         may be supressed by setting IMSLVERBOSE to FALSE.)
  216.  
  217.    Note: Because this uses a translated Fortran routine, it may not be
  218.       recursively invoked. It does not call itself, but the user should
  219.        be aware that he may not type ^A in the middle of an
  220. IMSL_ROMBERG         computation, begin another calculation using the
  221. same package,         and expect to win - IMSL_ROMBERG will complain if
  222. it was already         doing one project when you invoke it. This
  223. should cause minimal         problems.
  224.  
  225.    Purpose (modified version of the IMSL documentation)
  226. ---------------------------------------------------
  227.  
  228.    DCADRE attempts to solve the following problem: Given a real-valued
  229. function F of one argument, two real numbers A and B, find a number
  230.  
  231.    DCADRE such that:
  232.  
  233.      |   / B               |        [                              | / B      | ]
  234.      |   [                 |        [                              | [        | ]
  235.      |   I F(x)dx - DCADRE | <= max [ ROMBERG_AERR, ROMBERG_RERR * | I F(x)dx | ]
  236.      |   ]                 |        [                              | ]        | ]
  237.      |   / A               |        [                              | / A      | ]
  238.    Algorithm (modified version of the IMSL documentation)
  239.  
  240.    This routine uses a scheme whereby DCADRE is computed as the sum of
  241. estimates for the integral of F(x) over suitably chosen subintervals of
  242. the given interval of integration. Starting with the interval of
  243. integration itself as the first such subinterval, cautious Romberg
  244. extrapolation is used to find an acceptable estimate on a given
  245. subinterval. If this attempt fails, the subinterval is divided into two
  246. subintervals of equal length, each of which is considered separately.
  247. Programming Notes (modified version of the IMSL documentation)
  248.  
  249.    * 1. DCADRE (the translated-Fortran base for IMSL_ROMBERG) can, in
  250.      many cases,    handle jump discontinuities and certain algebraic
  251.      discontinuities. See    reference for full details.
  252.  
  253.    * 2. The relative error parameter ROMBERG_RERR must be in the
  254.      interval [0.0,0.1].     For example, ROMBERG_RERR=0.1 indicates
  255.      that the estimate of the intergral    is to be correct to one
  256.      digit, where as ROMBERG_RERR=1.0E-4 calls for four    digits of
  257.      accuracy. If DCADRE determines that the relative accuracy
  258.      requirement cannot be satisfied, IER is set to 133 (ROMBERG_RERR
  259.      should be    large enough that, when added to 100.0, the result is
  260.      a number greater than    100.0 (this will not be true of very tiny
  261.      floating point numbers due to    the nature of machine
  262.      arithmetic)).
  263.  
  264.    * 3. The absolute error parameter, ROMBERG_AERR, should be
  265.      nonnegative. In    order to give a reasonable value for
  266.      ROMBERG_AERR, the user must know    the approximate magnitude of
  267.      the integral being computed. In many cases,    it is satisfactory
  268.      to use AERR=0.0. In this case, only the relative error
  269.      requirement is satisfied in the compuatation.
  270.  
  271.    * 4. We quote from the reference, "A very cautious man would accept
  272.      DCADRE    only if IER [the warning or error code] is 0 or 65. The
  273.      merely reasonable    man would keep the faith even if IER is 66.
  274.      The adventurous man is quite    often right in accepting DCADRE
  275.      even if the IER is 131 or 132." Even when    IER is not 0, DCADRE
  276.      returns the best estimate that has been computed.
  277.  
  278.    For references on this technique, see de Boor, Calr, "CADRE: An
  279. Algorithm for Numerical Quadrature,"   Mathematical Software (John R.
  280. Rice, Ed.), New York, Academic Press,   1971, Chapter 7.
  281.  
  282. 
  283. File: maxima.info,  Node: ELLIPT,  Next: FOURIER,  Prev: DCADRE,  Up: Numerical
  284.  
  285. ELLIPT
  286. ======
  287.  
  288.    - A package on the SHARE directory for Numerical routines for
  289. Elliptic Functions and Complete Elliptic Integrals.  (Notation of
  290. Abramowitz and Stegun, Chs 16 and 17) Do LOAD(ELLIPT); to use this
  291. package.  At present all arguments MUST be floating point.  You'll get
  292. nonsense otherwise.  Be warned.  The functions available are: Jacobian
  293. elliptic functions
  294.  
  295.      AM(U,M) - amplitude with modulus M
  296.      AM1(U,M1) - amplitude with complementary modulus M1
  297.      AM(U,M):=AM1(U,1-M); so use AM1 if M ~ 1
  298.      SN(U,M):=SIN(AM(U,M));
  299.      CN(U,M):=COS(AM(U,M));
  300.      DN(U,M):=SQRT(1-M*SN(U,M)^2);
  301.      (These functions come defined like this.  Others CD, NS etc.  may be
  302.      similarly defined.)
  303.      Complete Elliptic Integrals
  304.      ELLIPTK(M) - Complete elliptic integral of first kind
  305.      ELLIPTK1(M1) - Same but with complementary modulus.
  306.      ELLIPTK(M):=ELLIPTK1(1-M); so use if M ~ 1
  307.      ELLIPTE(M) - Complete elliptic integral of second kind
  308.      ELLIPTE1(M1) - Same but with complementary modulus.
  309.      ELLIPTE(M):=ELLIPTE1(1-M); so use if M ~ 1
  310.  
  311. 
  312. File: maxima.info,  Node: FOURIER,  Next: NDIFFQ,  Prev: ELLIPT,  Up: Numerical
  313.  
  314. FOURIER
  315. =======
  316.  
  317.    - There is a Fast Fourier Transform package, do DESCRIBE(FFT) for
  318. details.  There is also a Fourier Series package.  It may be loaded
  319. with LOAD(FOURIE).  It will also calculate Fourier integral
  320. coefficients and has various other functions to do such things as
  321. replace all occurrences of F(ARG) by ARG in expression (like changing
  322. ABS(a*x+b) to a*x+b).  Do PRINTFILE(FOURIE,USAGE,DSK,SHARE1); for a
  323. list of the functions included.
  324.  
  325. 
  326. File: maxima.info,  Node: NDIFFQ,  Next: Definitions for Numerical,  Prev: FOURIER,  Up: Numerical
  327.  
  328. NDIFFQ
  329. ======
  330.  
  331.    a package residing on the SHARE directory for numerical solutions of
  332. differential equations.  LOAD("NDIFFQ"); will load it in for use.  An
  333. example of its use would be:
  334.  
  335.      Define_Variable(N,0.3,FLOAT);
  336.      Define_Variable(H,0.175,FLOAT);
  337.      F(X,E):=(Mode_Declare([X,E],FLOAT),N*EXP(X)/(E+X^(2*H)*EXP(H*X)));
  338.      Compile(F);
  339.      Array([X,E],FLOAT,35);
  340.      Init_Float_Array(X,1.0E-3,6.85); /* Fills X with the interval */
  341.      E[0]:5.0;                        /* Initial condition */
  342.      Runge_Kutta(F,X,E);              /* Solve it */
  343.      Graph2(X,E);                     /* Graph the solution */
  344.    p.s. Runge_Kutta(F,X,E,E_Prime) would be the call for a second-order
  345. equation.
  346.  
  347. 
  348. File: maxima.info,  Node: Definitions for Numerical,  Prev: NDIFFQ,  Up: Numerical
  349.  
  350. Definitions for Numerical
  351. =========================
  352.  
  353.  - Function: FFT (real-array, imag-array)
  354.      Fast Fourier Transform.  This package may be loaded by doing
  355.      LOAD(FFT); There is also an IFT command, for Inverse Fourier
  356.      Transform.  These functions perform a (complex) fast fourier
  357.      transform on either 1 or 2 dimensional FLOATING-POINT arrays,
  358.      obtained by:
  359.           ARRAY(<ary>,FLOAT,<dim1>); or
  360.           ARRAY(<ary>,FLOAT,<dim1>,<dim2>);
  361.      For 1D arrays
  362.           <dim1> = 2^n-1
  363.      and for 2D arrays
  364.           <dim1>=<dim2>=2^n-1
  365.      (i.e. the array is square).  (Recall that MACSYMA arrays are
  366.      indexed from a 0 origin so that there will be 2^n and (2^n)^2
  367.      arrays elements in the above two cases.)  This package also
  368.      contains two other functions, POLARTORECT and RECTTOPOLAR.  Do
  369.      DESCRIBE(cmd) for details. For details on the implementation, do
  370.      PRINTFILE(FFT,USAGE,SHARE); .
  371.  
  372.  
  373.  - Variable: FORTINDENT
  374.      default: [0] - controls the left margin indentation of expressions
  375.      printed out by the FORTRAN command.  0 gives normal printout (i.e.
  376.      6 spaces), and positive values will causes the expressions to be
  377.      printed farther to the right.
  378.  
  379.  
  380.  - Function: FORTMX (name,matrix)
  381.      converts a MACSYMA matrix into a sequence of FORTRAN assignment
  382.      statements of the form name(i,j)=<corresponding matrix element>.
  383.      This command is now obsolete.  FORTMX(name,matrix); may now be
  384.      done as FORTRAN(name=matrix);.  (If "name" is bound,
  385.      FORTRAN('name=matrix); may be necessary.)  Please convert code that
  386.      uses the FORTMX command as it may be flushed some day.
  387.  
  388.  
  389.  - Function: FORTRAN (exp)
  390.      converts exp into a FORTRAN linear expression in legal FORTRAN
  391.      with 6 spaces inserted at the beginning of each line, continuation
  392.      lines, and ** rather than ^ for exponentiation.  When the option
  393.      FORTSPACES[FALSE] is TRUE, the FORTRAN command fills out to 80
  394.      columns using spaces.  If FORTRAN is called on a bound symbolic
  395.      atom, e.g. FORTRAN(X); where X:A*B$ has been done, then X={value
  396.      of X}, e.g.  X=A*B will be generated.  In particular, if e.g.
  397.      M:MATRIX(...); has been done, then FORTRAN(M); will generate the
  398.      appropriate assignment statements of the form
  399.      name(i,j)=<corresponding matrix element>.  FORTINDENT[0] controls
  400.      the left margin of expressions printed out, 0 is the normal margin
  401.      (i.e. indented 6 spaces), increasing it will cause the expression
  402.      to be printed further to the right.
  403.  
  404.  
  405.  - Variable: FORTSPACES
  406.      default: [FALSE] - if TRUE, the FORTRAN command fills out to 80
  407.      columns using spaces.
  408.  
  409.  
  410.  - Function: HORNER (exp, var)
  411.      will convert exp into a rearranged representation as in Horner's
  412.      rule, using var as the main variable if it is specified.  Var may
  413.      also be omitted in which case the main variable of the CRE form of
  414.      exp is used.  HORNER sometimes improves stability if expr is to be
  415.      numerically evaluated.  It is also useful if MACSYMA is used to
  416.      generate programs to be run in FORTRAN (see DESCRIBE(STRINGOUT);)
  417.           (C1) 1.0E-20*X^2-5.5*X+5.2E20;
  418.                                           2
  419.           (D1)                   1.0E-20 X  - 5.5 X + 5.2E+20
  420.           (C2) HORNER(%,X),KEEPFLOAT:TRUE;
  421.           (D2)                  X (1.0E-20 X - 5.5) + 5.2E+20
  422.           (C3) D1,X=1.0E20;
  423.           ARITHMETIC OVERFLOW
  424.           (C4) D2,X=1.0E20;
  425.           (D4)                          6.9999999E+19
  426.  
  427.  - Function: IFT (real-array, imag-array)
  428.      Inverse Fourier Transform.  Do LOAD(FFT); to load in this package.
  429.      These functions (FFT and IFT) perform a (complex) fast fourier
  430.      transform on either 1 or 2 dimensional FLOATING-POINT arrays,
  431.      obtained by: ARRAY(<ary>,FLOAT,<dim1>); or
  432.      ARRAY(<ary>,FLOAT,<dim1>,<dim2>); For 1D arrays <dim1> must equal
  433.      2^n-1, and for 2D arrays <dim1>=<dim2>=2^n-1 (i.e. the array is
  434.      square).  (Recall that MACSYMA arrays are indexed from a 0 origin
  435.      so that there will be 2^n and (2^n)^2 arrays elements in the above
  436.      two cases.)  For details on the implementation, do
  437.      PRINTFILE(FFT,USAGE,SHARE); .
  438.  
  439.  
  440.  - Function: INTERPOLATE (func,x,a,b)
  441.      finds the zero of func as x varies.  The last two args give the
  442.      range to look in.  The function must have a different sign at each
  443.      endpoint.  If this condition is not met, the action of the of the
  444.      function is governed by INTPOLERROR[TRUE]).  If INTPOLERROR is
  445.      TRUE then an error occurs, otherwise the value of INTPOLERROR is
  446.      returned (thus for plotting INTPOLERROR might be set to 0.0).
  447.      Otherwise (given that MACSYMA can evaluate the first argument in
  448.      the specified range, and that it is continuous) INTERPOLATE is
  449.      guaranteed to come up with the zero (or one of them if there is
  450.      more than one zero).  The accuracy of INTERPOLATE is governed by
  451.      INTPOLABS[0.0] and INTPOLREL[0.0] which must be non-negative
  452.      floating point numbers.  INTERPOLATE will stop when the first arg
  453.      evaluates to something less than or equal to INTPOLABS or if
  454.      successive approximants to the root differ by no more than
  455.      INTPOLREL * <one of the approximants>.  The default values of
  456.      INTPOLABS and INTPOLREL are 0.0 so INTERPOLATE gets as good an
  457.      answer as is possible with the single precision arithmetic we
  458.      have.  The first arg may be an equation.  The order of the last
  459.      two args is irrelevant.  Thus
  460.  
  461.           INTERPOLATE(SIN(X)=X/2,X,%PI,.1);
  462.              is equivalent to
  463.           INTERPOLATE(SIN(X)=X/2,X,.1,%PI);
  464.      The method used is a binary search in the range specified by the
  465.      last two args.  When it thinks the function is close enough to
  466.      being linear, it starts using linear interpolation.  An
  467.      alternative syntax has been added to interpolate, this replaces the
  468.      first two arguments by a function name.  The function MUST be
  469.      TRANSLATEd or compiled function of one argument.  No checking of
  470.      the result is done, so make sure the function returns a floating
  471.      point number.
  472.  
  473.           F(X):=(MODE_DECLARE(X,FLOAT),SIN(X)-X/2.0);
  474.           INTERPOLATE(SIN(X)-X/2,X,0.1,%PI)       time= 60 msec
  475.           INTERPOLATE(F(X),X,0.1,%PI);            time= 68 msec
  476.           TRANSLATE(F);
  477.           INTERPOLATE(F(X),X,0.1,%PI);            time= 26 msec
  478.           INTERPOLATE(F,0.1,%PI);                 time=  5 msec
  479.  
  480.      There is also a Newton method interpolation routine, do
  481.      DESCRIBE(NEWTON); .
  482.  
  483.  
  484.  - Variable: INTPOLABS
  485.      default: [0.0] - The accuracy of the INTERPOLATE command is
  486.      governed by INTPOLABS[0.0] and INTPOLREL[0.0] which must be
  487.      non-negative floating point numbers.  INTERPOLATE will stop when
  488.      the first arg evaluates to something less than or equal to
  489.      INTPOLABS or if successive approximants to the root differ by no
  490.      more than INTPOLREL * <one of the approximants>.  The default
  491.      values of INTPOLABS and INTPOLREL are 0.0 so INTERPOLATE gets as
  492.      good an answer as is possible with the single precision arithmetic
  493.      we have.
  494.  
  495.  
  496.  - Variable: INTPOLERROR
  497.      default: [TRUE] - Governs the behavior of INTERPOLATE.  When
  498.      INTERPOLATE is called, it determines whether or not the function
  499.      to be interpolated satisfies the condition that the values of the
  500.      function at the endpoints of the interpolation interval are
  501.      opposite in sign.  If they are of opposite sign, the interpolation
  502.      proceeds.  If they are of like sign, and INTPOLERROR is TRUE, then
  503.      an error is signaled.  If they are of like sign and INTPOLERROR is
  504.      not TRUE, the value of INTPOLERROR is returned.  Thus for
  505.      plotting, INTPOLERROR might be set to 0.0.
  506.  
  507.  
  508.  - Variable: INTPOLREL
  509.      default: [0.0] - The accuracy of the INTERPOLATE command is
  510.      governed by INTPOLABS[0.0] and INTPOLREL[0.0] which must be
  511.      non-negative floating point numbers.  INTERPOLATE will stop when
  512.      the first arg evaluates to something less than or equal to
  513.      INTPOLABS or if successive approximants to the root differ by no
  514.      more than INTPOLREL * <one of the approximants>.  The default
  515.      values of INTPOLABS and INTPOLREL are 0.0 so INTERPOLATE gets as
  516.      good an answer as is possible with the single precision arithmetic
  517.      we have.
  518.  
  519.  
  520.  - Function: NEWTON (exp,var,X0,eps)
  521.      The file NEWTON 1 on the SHARE directory contains a function which
  522.      will do interpolation using Newton's method.  It may be accessed
  523.      by LOAD(NEWTON); .  The Newton method can do things that
  524.      INTERPOLATE will refuse to handle, since INTERPOLATE requires that
  525.      everything evaluate to a flonum. Thus
  526.      NEWTON(x^2-a^2,x,a/2,a^2/100); will say that it can't tell if
  527.      flonum*a^2<a^2/100. Doing ASSUME(a>0); and then doing NEWTON again
  528.      works. You get x=a+<small flonum>*a which is symbolic all the way.
  529.      INTERPOLATE(x^2-a^2,x,a/2,2*a); complains that .5*a is not
  530.      flonum...  An adaptive integrator which uses the Newton-Cotes 8
  531.      panel quadrature rule is available in SHARE1;QQ FASL.  Do
  532.      DESCRIBE(QQ) for details.
  533.  
  534.  
  535.  - Function: POLARTORECT (magnitude-array, phase-array)
  536.      converts from magnitude and phase form into real and imaginary
  537.      form putting the real part in the magnitude array and the
  538.      imaginary part into the phase array
  539.  
  540.           <real>=<magnitude>*COS(<phase>) ==>
  541.             <imaginary>=<magnitude>*SIN(<phase>
  542.  
  543.      This function is part of the FFT package.  Do LOAD(FFT); to use
  544.      it.  Like FFT and IFT this function accepts 1 or 2 dimensional
  545.      arrays.  However, the array dimensions need not be a power of 2,
  546.      nor need the 2D arrays be square.
  547.  
  548.  
  549.  - Function: RECTTOPOLAR (real-array, imag-array)
  550.      undoes POLARTORECT.  The phase is given in the range from -%PI to
  551.      %PI.  This function is part of the FFT package.  Do LOAD(FFT); to
  552.      use it.  Like FFT and IFT this function accepts 1 or 2 dimensional
  553.      arrays.  However, the array dimensions need not be a power of 2,
  554.      nor need the 2D arrays be square.
  555.  
  556.  
  557. 
  558. File: maxima.info,  Node: Statistics,  Next: Arrays and Tables,  Prev: Numerical,  Up: Top
  559.  
  560. Statistics
  561. **********
  562.  
  563. * Menu:
  564.  
  565. * Definitions for Statistics::
  566.  
  567. 
  568. File: maxima.info,  Node: Definitions for Statistics,  Prev: Statistics,  Up: Statistics
  569.  
  570. Definitions for Statistics
  571. ==========================
  572.  
  573.  - Function: GAUSS (mean,sd)
  574.      returns a random floating point number from a normal distribution
  575.      with mean MEAN and standard deviation SD.  This is part of the
  576.      BESSEL function package, do LOAD(BESSEL); to use it.
  577.  
  578.  
  579. 
  580. File: maxima.info,  Node: Arrays and Tables,  Next: Matrices and Linear Algebra,  Prev: Statistics,  Up: Top
  581.  
  582. Arrays and Tables
  583. *****************
  584.  
  585. * Menu:
  586.  
  587. * Definitions for Arrays and Tables::
  588.  
  589. 
  590. File: maxima.info,  Node: Definitions for Arrays and Tables,  Prev: Arrays and Tables,  Up: Arrays and Tables
  591.  
  592. Definitions for Arrays and Tables
  593. =================================
  594.  
  595.  - Function: ARRAY (name, dim1, dim2, ..., dimk)
  596.  - Function: ARRAY (name, type, dim1, dim2, ..., dimk)
  597.      This sets up a k-dimensional array.  A maximum of five dimensions
  598.      may be used.  In the first form, a general array is created.  In
  599.      the second form, an array meant to have elements of the specified
  600.      type is created.  TYPE can be fixnum for integers of limited size
  601.      or flonum for floating-point numbers.
  602.  
  603.      The subscripts for the ith dimension are the integers running from
  604.      0 to dimi.  If the user assigns to a subscripted variable before
  605.      declaring the corresponding array, an undeclared array is set up.
  606.      If the user has more than one array to be set up the same way,
  607.      they may all be set up at the same time, by
  608.      ARRAY([list-of-names],dim1, dim2, ..., dimk).  Undeclared arrays,
  609.      otherwise known as hashed arrays (because hash coding is done on
  610.      the subscripts), are more general than declared arrays.  The user
  611.      does not declare their maximum size, and they grow dynamically by
  612.      hashing as more elements are assigned values.  The subscripts of
  613.      undeclared arrays need not even be numbers.  However, unless an
  614.      array is rather sparse, it is probably more efficient to declare
  615.      it when possible than to leave it undeclared.  The ARRAY function
  616.      can be used to transform an undeclared array into a declared array.
  617.  
  618.  
  619.  - Function: ARRAYAPPLY (array,[sub1, ... ,subk])
  620.      is like APPLY except the first argument is an array.
  621.  
  622.  
  623.  - Function: ARRAYINFO (a)
  624.      returns a list of information about the array a.  For hashed
  625.      arrays it returns a list of "HASHED", the number of subscripts,
  626.      and the subscripts of every element which has a value.  For
  627.      declared arrays it returns a list of "DECLARED", the number of
  628.      subscripts, and the bounds that were given the the ARRAY function
  629.      when it was called on a.  Do EXAMPLE(ARRAYINFO); for an example.
  630.  
  631.  
  632.  - Function: ARRAYMAKE (name,[i1,i2,...])
  633.      returns name[i1,i2,...].
  634.  
  635.  
  636.  - Variable: ARRAYS
  637.      default: [] a list of all the arrays that have been allocated,
  638.      both declared and undeclared.  Functions which deal with arrays
  639.      are: ARRAY, ARRAYAPPLY, ARRAYINFO, ARRAYMAKE, FILLARRAY,
  640.      LISTARRAY, and REARRAY.
  641.  
  642.  - Function: BASHINDICES (expr)
  643.      - transforms the expression expr by giving each summation and
  644.      product a unique index. This gives CHANGEVAR greater precision
  645.      when it is working with summations or products.  The form of the
  646.      unique index is J<number>. The quantity <number> is determined by
  647.      referring to GENSUMNUM, which can be changed by the user.  For
  648.      example, GENSUMNUM:0$ resets it.
  649.  
  650.  
  651.  - Function: FILLARRAY (array,list-or-array)
  652.      fills array from list-or-array.  If array is a floating-point
  653.      (integer) array then list-or-array should be either a list of
  654.      floating-point (integer) numbers or another floating-point
  655.      (integer) array.  If the dimensions of the arrays are different
  656.      array is filled in row-major order.  If there are not enough
  657.      elements in list-or-array the last element is used to fill out the
  658.      rest of array.  If there are too many the remaining ones are thrown
  659.      away.  FILLARRAY returns its first argument.
  660.  
  661.  
  662.  - Function: GETCHAR (a, i)
  663.      returns the ith character of the quoted string or atomic name a.
  664.      This function is useful in manipulating the LABELS list.
  665.  
  666.  
  667.  - Function: LISTARRAY (array)
  668.      returns a list of the elements of a declared or hashed array.  the
  669.      order is row-major.  Elements which you have not defined yet will
  670.      be represented by #####.
  671.  
  672.  
  673.  - Function: MAKE_ARRAY (type,dim1,dim2,...,dimn)
  674.      - creates an array.  "type" may be 'ANY, 'FLONUM, 'FIXNUM, 'HASHED
  675.      or 'FUNCTIONAL.  This is similar to the ARRAY command, except that
  676.      the created array is a functional array object.  The advantage of
  677.      this over ARRAY is that it doesn't have a name, and once a pointer
  678.      to it goes away, it will also go away.  e.g.  Y:MAKE_ARRAY(....);
  679.      Y now points to an object which takes up space, but do Y:FALSE,
  680.      and Y no longer points to that object, so the object will get
  681.      garbage collected.  Note: the "dimi" here are different from the
  682.      ARRAY command, since they go from 0 to i-1, i.e.  a "dimension" of
  683.      10 means you have elements from 0 to 9.
  684.      Y:MAKE_ARRAY('FUNCTIONAL,'F,'HASHED,1) - The second argument to
  685.      MAKE_ARRAY in this case is the function to call to calculate array
  686.      elements, and the rest of the arguments are passed recursively to
  687.      MAKE_ARRAY to generate the "memory" for the array function object.
  688.  
  689.  
  690.  - Function: REARRAY (array,dim1, ... ,dimk)
  691.      can be used to change the size or dimensions of an array.  The new
  692.      array will be filled with the elements of the old one in row-major
  693.      order.  If the old array was too small, FALSE, 0.0 or 0 will be
  694.      used to fill the remaining elements, depending on the type of the
  695.      array.  The type of the array cannot be changed.
  696.  
  697.  
  698.  - Function: REMARRAY (name1, name2, ...)
  699.      removes arrays and array associated functions and frees the
  700.      storage occupied.  If name is ALL then all arrays are removed.  It
  701.      may be necessary to use this function if it is desired to redefine
  702.      the values in a hashed array.
  703.  
  704.  
  705.  - Variable: USE_FAST_ARRAYS
  706.      [TRUE on Lispm] - If TRUE then only two types of arrays are
  707.      recognized.
  708.  
  709.      1) The art-q array (t in common lisp) which may have several
  710.      dimensions indexed by integers, and may hold any lisp or macsyma
  711.      object as an entry.  To construct such an array, enter
  712.      A:MAKE_ARRAY(ANY,3,4); then A will have as value, an array with
  713.      twelve slots, and the indexing is zero based.
  714.  
  715.      2) The Hash_table array which is the default type of array created
  716.      if one does B[X+1]:Y^2 (and B is not already an array,a list, or a
  717.      matrix- if it were one of these an error would be caused since x+1
  718.      would not be a valid subscript for an art-q array,a list or a
  719.      matrix ).  Its indices (also known as keys) may be any object.  It
  720.      only takes ONE KEY at a time (B[X+1,U]:Y would ignore the u)
  721.      Referencing is done by B[X+1]==> Y^2.  Of course the key may be a
  722.      list, eg B[[x+1,u]]:y would be valid.  This is in- compatible with
  723.      the old Macsyma hash arrays, but saves consing.
  724.  
  725.      An advantage of storing the arrays as values of the symbol is that
  726.      the usual conventions about local variables of a function apply to
  727.      arrays as well.  The Hash_table type also uses less consing and is
  728.      more efficient than the old type of macsyma hashar.  To obtain
  729.      consistent behaviour in translated and compiled code set
  730.      TRANSLATE_FAST_ARRAYS [TRUE] to be TRUE.
  731.  
  732.  
  733. 
  734. File: maxima.info,  Node: Matrices and Linear Algebra,  Next: Affine,  Prev: Arrays and Tables,  Up: Top
  735.  
  736. Matrices and Linear Algebra
  737. ***************************
  738.  
  739. * Menu:
  740.  
  741. * Introduction to Matrices and Linear Algebra::
  742. * Definitions for Matrices and Linear Algebra::
  743.  
  744. 
  745. File: maxima.info,  Node: Introduction to Matrices and Linear Algebra,  Next: Definitions for Matrices and Linear Algebra,  Prev: Matrices and Linear Algebra,  Up: Matrices and Linear Algebra
  746.  
  747. Introduction to Matrices and Linear Algebra
  748. ===========================================
  749.  
  750. * Menu:
  751.  
  752. * DOT::
  753. * VECTORS::
  754.  
  755. 
  756. File: maxima.info,  Node: DOT,  Next: VECTORS,  Prev: Introduction to Matrices and Linear Algebra,  Up: Introduction to Matrices and Linear Algebra
  757.  
  758. DOT
  759. ---
  760.  
  761.    - . The dot operator, for matrix (non-commutative) multiplication.
  762. When "." is used in this way, spaces should be left on both sides of
  763. it, e.g. A . B.  This distinguishes it plainly from a decimal point in
  764. a floating point number.  Do APROPOS(DOT); for a list of the switches
  765. which affect the dot operator.
  766.  
  767. 
  768. File: maxima.info,  Node: VECTORS,  Prev: DOT,  Up: Introduction to Matrices and Linear Algebra
  769.  
  770. VECTORS
  771. -------
  772.  
  773.    - The file SHARE;VECT > contains a vector analysis package,
  774. share/vect.dem contains a corresponding demonstration, and SHARE;VECT
  775. ORTH contains definitions of various orthogonal curvilinear coordinate
  776. systems.  LOAD(VECT); will load this package for you.  The vector
  777. analysis package can combine and simplify symbolic expressions
  778. including dot products and cross products, together with the gradient,
  779. divergence, curl, and Laplacian operators.  The distribution of these
  780. operators over sums or products is under user control, as are various
  781. other expansions, including expansion into components in any specific
  782. orthogonal coordinate systems.  There is also a capability for deriving
  783. the scalar or vector potential of a field.  The package contains the
  784. following commands: VECTORSIMP, SCALEFACTORS, EXPRESS, POTENTIAL, and
  785. VECTORPOTENTIAL.  Do DESCRIBE(cmd) on these command names, or
  786. PRINTFILE(VECT,USAGE,SHARE); for details.  Warning:  The VECT package
  787. declares "." to be a commutative operator.
  788.  
  789.